using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.IO;
using System.Reflection;

namespace SkinMe
{
    /// <summary>
    /// Interaction logic for Window1.xaml
    /// </summary>

    public partial class Window1 : System.Windows.Window
    {

        public Window1()
        {
            InitializeComponent();
            this.ListData.DataContext = Directory.GetFiles(".", "*.xaml");
        }

        public void Click_Me(object sender, RoutedEventArgs e)
        {

            if (ListData.SelectedItem != null)
            {
                System.Diagnostics.ProcessStartInfo psi = new System.Diagnostics.ProcessStartInfo();
                psi.FileName = Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName;
                psi.Arguments = ListData.SelectedItem.ToString();

                System.Diagnostics.Process.Start(psi); 
                this.Close();
            }

        }

    }
}